package edu.thu.studio.ormdesigner.model.domain;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;

import edu.thu.studio.ormdesigner.model.AbstractObjectModel;
import edu.thu.studio.ormdesigner.util.Utils;

@XStreamAlias("domain")
public class Domain extends AbstractObjectModel {
    
    private static final long serialVersionUID = 6998985022414351214L;
    @XStreamAsAttribute
    @XStreamAlias("data-type")
    private String dataType;
    
    @XStreamAsAttribute
    private Integer length;
    
    @XStreamAsAttribute
    private Integer precision;
    
    public String getDataType() {
    	if(Utils.isNull(dataType))
    		return "";
        return dataType;
    }
    
    public void setDataType(String dataType) {
        this.dataType = dataType;
    }
    
    public Integer getLength() {
        return length;
    }
    
    public void setLength(Integer length) {
        this.length = length;
    }
    
    public Integer getPrecision() {
        return precision;
    }
    
    public void setPrecision(Integer precision) {
        this.precision = precision;
    }
    
}
